<template>
	<div>
		<cl-crud @load="onLoad">
			<template #slot-filter>
				<div class="nav base-flex">
					<div class="nav-li">
						<filterGstatus
							@change="
								val =>
									refresh({
										status: val
									})
							"
						></filterGstatus>
					</div>
					<div class="nav-li">
						活动时间：
						<date-picker
							@change="
								val => refresh({ startTime: val[0], endTime: val[1], page: 1 })
							"
							@refresh="refresh({ startTime: '', endTime: '', page: 1 })"
						></date-picker>
					</div>
					<div class="nav-li">
						活动类型：
						<el-select
							size="mini"
							filterable
							placeholder="活动类型"
							v-model="goodsType"
							style="margin-right: 1em;width:120px;"
							@change="val => refresh({ type: val, page: 1 })"
						>
							<el-option value label="全部"></el-option>
							<el-option label="零元购" :value="0"></el-option>
							<el-option label="限时抢购" :value="1"></el-option>
							<el-option label="新人专享" :value="2"></el-option>
							<el-option label="百亿补贴" :value="3"></el-option>
							<el-option label="大转盘" :value="4"></el-option>
							<el-option label="微信京礼金" :value="5"></el-option>
						</el-select>
					</div>
					<div class="nav-li">
						<span style="font-size:12px">是否置顶：</span>
						<el-select
							size="mini"
							filterable
							placeholder="是否置顶"
							style="margin-right: 1em;width:100px;"
							v-model="filterSelectVal.isTop"
							@change="val => crud.refresh({ top: val, page: 1 })"
						>
							<el-option value label="全部"></el-option>
							<el-option label="是" :value="1"></el-option>
							<el-option label="否" :value="0"></el-option>
						</el-select>
					</div>

					<div class="nav-li">
						<span style="font-size:12px">商品类型：</span>
						<el-select
							size="mini"
							filterable
							placeholder="商品类型"
							style="margin-right: 1em;width:100px;"
							v-model="options.specialClassifyVal"
							@change="val => crud.refresh({ floorId: val, page: 1 })"
						>
							<el-option value="" label="全部"></el-option>
							<el-option
								v-for="item in options.specialClassify"
								:key="item.value"
								:label="item.label"
								:value="item.value"
							></el-option>
						</el-select>
					</div>

					<div class="nav-li">
						<span style="font-size:12px">券后价：</span>
						<el-input-number
							v-model="options.price1"
							controls-position="right"
							style="width:60px;"
							size="mini"
						></el-input-number>
						<span style="font-size:16px;margin-right:0px"> - </span>
						<el-input-number
							v-model="options.price2"
							controls-position="right"
							style="width:60px;"
							size="mini"
						></el-input-number>
						<el-button
							style="margin-left:1em"
							size="mini"
							@click="
								crud.refresh({
									epStartPrice: options.price1,
									epEndPrice: options.price2
								})
							"
							>确定</el-button
						>
					</div>

					<div class="nav-li">
						<span style="font-size:12px">优惠券：</span>
						<el-input-number
							v-model="options.couponMoneyStart"
							controls-position="right"
							style="width:60px;"
							size="mini"
						></el-input-number>
						<span style="font-size:16px;margin-right:0px"> - </span>
						<el-input-number
							v-model="options.couponMoneyEnd"
							controls-position="right"
							style="width:60px;"
							size="mini"
						></el-input-number>
						<el-button
							style="margin-left:1em"
							size="mini"
							@click="
								crud.refresh({
									couponMoneyStart: options.couponMoneyStart,
									couponMoneyEnd: options.couponMoneyEnd
								})
							"
							>确定</el-button
						>
					</div>
				</div>
			</template>
			<template #slot-add>
				<el-button type="danger" size="mini" @click="addGoods()">录入商品</el-button>
				<el-button size="mini" @click="putWayGoods()">自动上品规则配置</el-button>
			</template>
			<template #slot-setSort="{scope}">
				<p class="setsort" @click="setGoodsort(scope.row)">修改</p>
			</template>
			<template #slot-delete="{scope}">
				<delBtn @del="crud.delete(scope.row)"></delBtn>
			</template>
			<template #table-column-goodInfo="{scope}">
				<jd-good-info :item="scope.row"></jd-good-info>
			</template>
			<template #table-column-couponInfo="{scope}">
				<coupon-info :item="scope.row"></coupon-info>
			</template>
			<template #table-column-status="{scope}">
				<div>
					<el-tag v-if="scope.row.status == 1" type="success">正常</el-tag>
					<el-tooltip
						class="item"
						effect="dark"
						:content="scope.row.reason"
						placement="top"
						v-if="scope.row.status == 2"
					>
						<el-tag type="info">已下架</el-tag>
					</el-tooltip>
				</div>
			</template>

			<!-- 数据统计 -->
			<template #table-column-count="{scope}">
				<div class="column-count">
					<p>
						免单金额：
						<span>{{ scope.row.mdMoney | toFixed(2) }}</span>
					</p>
					<p>
						京礼金金额：
						<span>{{ scope.row.jljMoney | toFixed(2) }}</span>
					</p>
					<p>
						总数：
						<span>{{ scope.row.total }}</span>
					</p>
					<p>
						剩余数量：
						<span>{{ scope.row.surplus }}</span>
					</p>
				</div>
			</template>

			<!-- 活动时间 -->
			<template #table-column-date="{scope}">
				<p>活动开始时间：{{ (scope.row.startTime * 1000) | date_format }}</p>
				<p>活动结束时间：{{ (scope.row.endTime * 1000) | date_format }}</p>
			</template>
			<template #table-column-type="{scope}">
				<div v-if="scope.row.type == 0">零元购</div>
				<div v-if="scope.row.type == 1">限时抢购</div>
				<div v-if="scope.row.type == 2">新人专享</div>
				<div v-if="scope.row.type == 3">百亿补贴</div>
				<div v-if="scope.row.type == 4">大转盘</div>
				<div v-if="scope.row.type == 5">微信京礼金</div>
			</template>
		</cl-crud>

		<cl-form ref="cl-form"></cl-form>
		<cl-form ref="cl-form2"></cl-form>
		<!-- 自动上品 -->
		<el-dialog title="编辑" :visible.sync="putWayVisible">
			<div>
				<el-form :model="putWayForm" ref="putWay" label-width="200px">

					<el-form-item
						label="关键词屏蔽"
						prop="keyWords"
						:rules="{
							required: true,
							message: '请输入关键词',
							trigger: 'blur'
						}"
					>
						<el-row>
							<el-col :span="12">
								<el-input
									v-model="putWayForm.keyWords"
									type="textarea"
									autosize
								></el-input>
							</el-col>
						</el-row>
						<div>备注：请输入要屏蔽的的关键词并用英文逗号隔开</div>
					</el-form-item>
					<el-form-item
						label="佣金区间"
						prop="minCommissionRate"
						:rules="{
							required: true,
							message: '请输入佣金',
							trigger: 'blur'
						}"
					>
						<el-row :gutter="20">
							<el-col :span="4">
								<el-input v-model="putWayForm.minCommissionRate" size="mini"></el-input>
							</el-col>
							<el-col :span="4"
								><el-input v-model="putWayForm.maxCommissionRate" size="mini"></el-input
							></el-col>
						</el-row>
					</el-form-item>
					<el-form-item
						label="券后价区间"
						prop="minEndPrice"
						:rules="{
							required: true,
							message: '请输入券后价',
							trigger: 'blur'
						}"
					>
						<el-row :gutter="20">
							<el-col :span="4"
								><el-input v-model="putWayForm.minEndPrice" size="mini"></el-input
							></el-col>
							<el-col :span="4"
								><el-input v-model="putWayForm.levelOneEndPrice" size="mini"></el-input
							></el-col>
							<el-col :span="4"
								><el-input v-model="putWayForm.levelTwoEndPrice" size="mini"></el-input
							></el-col>
							<el-col :span="4"
								><el-input v-model="putWayForm.maxEndPrice" size="mini"></el-input
							></el-col>
						</el-row>
					</el-form-item>
					<el-form-item
						label="补贴金区间"
						prop="minCommissionRate"
						:rules="{
							required: true,
							message: '请输入补贴金区间',
							trigger: 'blur'
						}"
					>
						<el-row :gutter="20">
							<el-col :span="4">
								<el-input v-model="putWayForm.minTljMoney" size="mini"></el-input>
							</el-col>
							<el-col :span="4"
								><el-input v-model="putWayForm.maxTljMoney" size="mini"></el-input
							></el-col>
						</el-row>
					</el-form-item>
					<el-form-item
						label="上品上限"
						prop="limitSum"
						:rules="{
							required: true,
							message: '请输入上品上限',
							trigger: 'blur'
						}"
					>
						<el-row :gutter="20">
							<el-col :span="4">
								<el-input v-model="putWayForm.limitSum" size="mini"></el-input>
							</el-col>
						</el-row>
					</el-form-item>
					<el-form-item
						label="补贴金比例"
						prop="tljRate"
						:rules="{
							required: true,
							message: '请输入补贴金比例',
							trigger: 'blur'
						}"
					>
						<el-row>
							<el-col :span="4"
								><el-input :disabled="true" type="number" :min="0" :max="1" v-model="putWayForm.tljRate" size="mini"></el-input
							></el-col>
						</el-row>
					</el-form-item>
					<el-form-item label="抓取类目数量">
						<el-row>
							<el-col :span="4">
								<el-button @click="openForm_CRUD">请选择类目</el-button>
							</el-col>
						</el-row>
					</el-form-item>
					<el-form-item>
						<el-button size="mini" @click="savePutWay">保存</el-button>
					</el-form-item>
				</el-form>
			</div>
		</el-dialog>
	</div>
</template>

<script>
import JdGoodInfo from '@/views/goodsMenagement/components/list/jd-good-info';
import couponInfo from './components/list/coupon-info';
import searchCounpon from './components/list/searchCoupon';
import filterGstatus from '@/views/goodsMenagement/components/filterGstatus';
import { platform } from '@/dict/index';
import { Type_TLJ } from '@/dict/index';
import moment from 'moment';
import store from 'store';
import DatePicker from '@/components/common/date-picker';
import openCurd from '../goodsMenagement/components/openFormBwbt2';

export default {
	data() {
		return {
			crud: null,
			platform: platform,
			platformIndex: '',
			mail: '',
			dou: '',
			filterSelectVal: {
				amount: 0, //劵金额
				monthSales: 0, //月销量
				isNine: '',
				isDouGoods: '',
				isTop: ''
			},
			enterGoodsInfo: {},
			accountList: [], // 淘宝联盟列表
			fromList: [], // 平台列表
			typeOptions: [],
			perfaceValue_GoodInfo: 0,
			perfaceValue_Rush: 0,
			perfaceValue_Zero: 0,
			goodsTitle: '',
			actime: [],
			goodsTypeMemory: '',
			selects: {
				coupon: {},
				date: []
			},
			goodsType: '',
			options: {
				specialClassify: [],
				specialClassifyVal: '',
				price1: 0,
				price2: 0,
				couponMoneyStart: 0,
				couponMoneyEnd: 0
			},
			typeOptions2: [],
			putWayVisible: false,
			putWayForm: {
				levelOneEndPrice: '',
				levelTwoEndPrice: '',
				minTljMoney: '', //最低补贴金
				maxTljMoney: '',
				keyWords: '',
				minCommissionRate: '', // 佣金
				maxCommissionRate: '',
				minEndPrice: '', // 券后价
				maxEndPrice: '', // 券后价
				limitSum: '', //上品上线
				tljRate: 0 // 补贴金比例
			}
		};
	},
	components: {
		JdGoodInfo,
		couponInfo,
		// eslint-disable-next-line
		searchCounpon,
		filterGstatus,
		DatePicker
	},
	created() {
		this.actime = [
			moment(new Date().getTime() + 86400000).format('YYYY-MM-DD 00:00:00'),
			moment(new Date().getTime() + 172800000).format('YYYY-MM-DD 00:00:00')
		];
		this.taobaoAccountTlj();
		this.getType();
		this.platForm();
	},
	methods: {
		// 获取百亿补贴类型
		getType() {
			// 获取百万补贴商品分类
			this.$service.goodsMenagement.specialClassify
				.page({
					page: 1,
					size: 60,
					sort: 'asc',
					order: 'level',
					specialType: 104
				})
				.then(res => {
					var temp = res.list;
					var target = [];
					for (var i = 0; i < temp.length; i++) {
						target[i] = { label: temp[i].mainName, value: temp[i].floorId };
					}
					this.options.specialClassify = target;
				});
		},
		// 获取联盟账号
		async taobaoAccountTlj() {
			let list = await this.$service.goodsMenagement.taobaoAccountTlj.userAccountList();
			list = list.map(item => {
				return {
					label: item.accountName,
					value: item.accountId
				};
			});
			this.accountList = list;
		},
		// 获取平台账号
		platForm() {
			this.$service.common.userAppList().then(res => {
				let list = res.map(el => {
					return {
						label: el.name,
						value: el.key
					};
				});
				this.fromList = list;
			});
		},
		submitForm(formData) {
			this.crud.setForm('data', formData);
			this.crud.submit();
		},
		setGoodsort(item) {
			const self = this;
			this.$refs['cl-form'].open({
				title: '修改',
				props: {
					'label-width': '100px',
					width: '570px',
					center: true,
					'custom-class': 'custom-class-dialog-mini'
				},
				items: [
					{
						prop: 'skuImage',
						label: '商品主图：',
						span: 24,
						value: item.skuImage,
						component: {
							name: 'cl-upload'
						}
					},
					{
						prop: 'skuName',
						label: '商品标题',
						span: 24,
						value: item.skuName,
						component: {
							name: 'el-input',
							attrs: {
								size: 'mini'
							}
						}
					},
					{
						prop: 'level',
						label: '排序值',
						span: 24,
						value: item.level ? item.level : 100,
						component: {
							name: 'level-input',
							data() {
								return {
									value2: 0
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.value2 = this.value;
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<div style="display:flex">
										<el-input-number
											controls-position="right"
											min={1}
											max={100000}
											onInput={this.input}
											v-model={this.value2}></el-input-number>
										<span style="color:red;margin-left:10px">
											* 序号越大，排序越靠前
										</span>
									</div>
								);
							}
						},
						rules: [{ required: true, message: '排序不能为空', trigger: 'blur' }]
					},
					{
						prop: 'defNum',
						label: '商品基数',
						span: 11,
						value: item.defNum,
						component: {
							name: 'el-input-number',
							props: {
								min: 0
							}
						},
						rules: {
							required: true
						}
					},
					{
						prop: 'status',
						label: '是否上架',
						span: 24,
						value: item.status,
						component: {
							name: 'el-input-number1',
							attrs: {
								'controls-position': 'right',
								min: 1,
								max: 10000
							},
							data() {
								return {
									value2: 1
								};
							},
							props: {
								value: [String, Number]
							},
							methods: {
								change(e) {
									this.$emit('input', e);
								}
							},
							mounted() {
								this.value2 = this.value;
							},
							render() {
								return (
									<el-radio-group onChange={this.change} v-model={this.value2}>
										<el-radio label={1}>上架</el-radio>
										<el-radio label={2}>下架</el-radio>
									</el-radio-group>
								);
							}
						},
						rules: [{ required: true, message: '免单总数不能为空', trigger: 'blur' }]
					},
					{
						prop: 'top',
						label: '是否置顶：',
						value: 1,
						component: {
							name: 'z_radio',
							data() {
								return {
									value2: 1
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.value2 = Number(this.value || 1);
							},
							methods: {
								change(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<el-radio-group onChange={this.change} v-model={this.value2}>
										<el-radio label={1}>是</el-radio>
										<el-radio label={0}>否</el-radio>
									</el-radio-group>
								);
							}
						}
					}
				],
				on: {
					submit({ data, close }) {
						self.$service.jd.jdActivityGoods
							.update({
								...data,
								id: item.id
							})
							.then(() => {
								self.$message({
									message: '设置成功',
									type: 'success'
								});
								self.crud.refresh();
								close();
								return;
							})
							.catch(err => {
								self.$message.error(err);
							});
					}
				}
			});
		},
		// 设置百亿补贴
		setGoodInfo(item) {
			const self = this;
			const subsidyData = store.get('set-subsidy') || {};

			this.$refs['cl-form2'].open({
				props: {
					labelWidth: '120px',
					center: true,
					'custom-class': 'custom-class-dialog',
					width: '750px'
				},
				items: [
					{
						prop: 'pic',
						label: '商品主图：',
						span: 24,
						component: {
							name: 'cl-upload'
						}
					},
					{
						prop: 'title',
						label: '商品标题',
						span: 24,
						component: {
							name: 'el-input',
							attrs: {
								size: 'mini'
							}
						}
					},
					{
						prop: 'accountIds',
						label: '账号',
						span: 13,
						value: subsidyData.accountIds || [self.accountList[0].value],
						component: {
							name: 'el-select',
							options: self.accountList,
							attrs: {
								placeholder: '请选择账号',
								multiple: true
							},
							on: {
								change: id => {
									console.log(id);
								}
							}
						},
						rules: {
							required: true,
							message: '账号不能为空'
						}
					},

					{
						prop: 'campaignType',
						label: '创建类型',
						span: 10,
						value: 2,
						component: {
							name: 'el-select',
							attrs: {
								placeholder: '请选择'
							},
							props: {
								clearable: true
							},
							options: Type_TLJ
						},
						rules: {
							required: true,
							message: '创建类型不能为空'
						}
					},
					{
						prop: 'gid',
						label: '商品ID',
						span: 10,
						value: item.gid,
						component: {
							name: 'el-input',
							attrs: {
								placeholder: '请选择'
							},
							props: {}
						}
					},
					{
						prop: 'url',
						props: {
							labelWidth: '0px'
						},
						component: {
							name: 'search-counpon',
							props: {
								item: Object
							},
							attrs: {
								item
							},
							mounted() {
								console.log('itemitem', this.item);
								this.$refs['real'].ruleForm.url = this.item.link;
								this.$refs['real'].ruleForm.couponUrl = this.item.couponUrl;
								this.$refs['real'].ruleForm.gid = this.item.gid;
								this.$refs['real'].submitForm('form');
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								},
								Goodsinfo(e) {
									self.enterGoodsInfo = e;
									self.goodsTitle = e.title.substring(0, 10);
								},
								perface(e) {
									self.perfaceValue_GoodInfo = e;
								},
								onCoupon(e) {
									console.log(e);
									self.selects.coupon = e;
								}
							},
							render() {
								return (
									<searchCounpon
										ref="real"
										onInput={this.input}
										onGoodsInfo={this.Goodsinfo}
										onperface={this.perface}
										{...{
											on: {
												coupon: this.onCoupon
											}
										}}
										item={self.enterGoodsInfo}></searchCounpon>
								);
							}
						},
						rules: [{ required: true, message: '请先检索商品', trigger: 'blur' }]
					},
					{
						prop: 'floorId',
						label: '商品分类',
						span: 12,
						value: subsidyData.floorId || self.goodsTypeMemory,
						component: {
							name: 'el-select',
							attrs: {
								placeholder: '请选择'
							},
							props: {
								clearable: true
							},
							options: self.typeOptions,
							on: {
								change: id => {
									self.goodsTypeMemory = id;
									console.log(id);
								}
							}
						},
						rules: {
							required: true,
							message: '商品分类不能为空'
						}
					},
					{
						prop: 'tljMoney',
						label: '淘礼金金额：',
						component: {
							name: 'mdMoney_c',
							data() {
								return {
									value2: 0
								};
							},
							methods: {
								Change() {
									this.$emit('input', self.perfaceValue_GoodInfo);
									if (
										this.value2 >=
										(self.enterGoodsInfo.endPrice -
											self.enterGoodsInfo.hzQuanOver) *
											0.8
									) {
										self.$message.error('淘礼金金额不能大于商品券后价的80%');
									}
								}
							},

							render() {
								return (
									<div style="display:flex">
										<el-input-number
											max={
												Number(
													self.enterGoodsInfo.endPrice -
														self.enterGoodsInfo.hzQuanOver
												) * 0.8 || 0
											}
											step={0.01}
											min={1}
											v-model={self.perfaceValue_GoodInfo}
											onfocus={this.Change}
											onChange={this.Change}></el-input-number>
										<div style="margin-left:10px">
											到手价格￥
											<span style="color:red">
												{(
													parseFloat(self.enterGoodsInfo.endPrice || 0) -
													(self.perfaceValue_GoodInfo
														? self.perfaceValue_GoodInfo
														: 0) -
													(self.enterGoodsInfo.hzQuanOver || 0)
												).toFixed(2)}
											</span>
											元
										</div>
									</div>
								);
							}
						}
					},
					{
						prop: 'tljName',
						label: '淘礼金名称',
						value: self.goodsTitle,
						component: {
							name: 'tljName-input',
							attrs: {
								placeholder: '请输入名称',
								clearable: true,
								maxlength: 10
							},
							methods: {
								Change() {
									this.$emit('input', self.goodsTitle);
								}
							},
							render() {
								return (
									<el-input
										v-model={self.goodsTitle}
										onChange={this.Change}
										onfocus={this.Change}></el-input>
								);
							}
						},
						rules: [
							{
								required: true,
								message: '淘礼金名字不能为空'
							},
							{
								min: 5,
								max: 10,
								message: '淘礼金名字在5 ~ 10个字符之间'
							}
						]
					},
					{
						prop: 'total',
						label: '活动商品个数：',
						span: 8,
						value: parseInt(Math.random() * (10000 - 5000 + 1) + 5000, 10),
						component: {
							name: 'el-input-number',
							attrs: {
								'controls-position': 'right',
								min: 1,
								max: 10000
							}
						},
						rules: [
							{
								required: true,
								message: '请输入活动商品数量',
								trigger: 'blur'
							}
						]
					},
					{
						prop: 'time',
						label: '活动时间：',
						value: subsidyData.time || self.actime,
						span: 16,
						component: {
							name: 'el-date-picker',
							attrs: {
								type: 'datetimerange',
								'value-format': 'yyyy-MM-dd HH:mm:ss'
							}
						},
						rules: [
							{
								required: true,
								message: '请选择活动时间',
								trigger: 'blur'
							}
						]
					},
					{
						prop: 'level',
						label: '商品排序：',
						value: 100,
						component: {
							name: 'levels',
							data() {
								return {
									level: 100
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.level = this.value;
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<div>
										<el-input-number
											v-model={this.level}
											controls-position="right"
											onInput={this.input}
											min={1}
											max={10000}></el-input-number>
										<span style="color:#999999;margin-left:10px">
											序号越大，排序越靠前
										</span>
									</div>
								);
							}
						}
					},
					{
						prop: 'defNum',
						label: '初始领取数量：',
						value: parseInt(Math.random() * 2000) + 4000,
						span: 13,
						component: {
							name: 'el-input-number'
						}
					},
					{
						prop: 'status',
						label: '商品状态：',
						value: 1,
						component: {
							name: 'g_radio',
							data() {
								return {
									value2: 1
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.value2 = Number(this.value || 1);
							},
							methods: {
								change(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<el-radio-group onChange={this.change} v-model={this.value2}>
										<el-radio label={1}>上架</el-radio>
										<el-radio label={0}>下架</el-radio>
									</el-radio-group>
								);
							}
						}
					}
				],
				op: {
					visible: true,
					layout: ['confirm']
				},
				on: {
					load() {},
					submit({ data, close, done }) {
						store.set('set-subsidy', {
							floorId: data.floorId,
							accountIds: data.accountIds,
							time: data.time
						});

						data.quanMLink = self.enterGoodsInfo.quanMLink;
						data.hzQuanOver = self.enterGoodsInfo.hzQuanOver;

						self.$service.goodsMenagement.mdGoods
							.add({
								...data,
								...data.url,
								type: 3,
								gid: item.gid,
								startTime: data.time[0],
								endTime: data.time[1],
								tljType: 1,
								accountIds: data.accountIds.join(',')
							})
							.then(() => {
								self.$message({
									message: '设置成功',
									type: 'success'
								});
								self.crud.refresh();
								close();
								return;
							})
							.catch(err => {
								self.$message.error(err);
								done();
							});
					}
				}
			});
		},
		// 设置限时抢购
		setRushInfo(item) {
			let self = this;
			this.$refs['cl-form'].open({
				props: {
					labelWidth: '120px',
					center: true,
					'custom-class': 'custom-class-dialog'
				},
				items: [
					{
						prop: 'pic',
						label: '商品主图：',
						span: 24,
						component: {
							name: 'cl-upload'
						}
					},
					{
						prop: 'title',
						label: '商品标题',
						span: 24,
						component: {
							name: 'el-input',
							attrs: {
								size: 'mini'
							}
						}
					},
					{
						prop: 'app',
						label: '平台',
						span: 13,
						value: [self.fromList[0].value],
						component: {
							name: 'el-select',
							options: self.fromList,
							attrs: {
								placeholder: '请选择平台',
								multiple: true
							},
							on: {
								change: id => {
									console.log(id);
								}
							}
						},
						rules: {
							required: true,
							message: '账号不能为空'
						}
					},
					{
						prop: 'gid',
						label: '商品ID',
						span: 10,
						value: item.gid,
						component: {
							name: 'el-input',
							attrs: {
								placeholder: '请选择'
							},
							props: {}
						}
					},
					{
						prop: 'url',
						props: {
							labelWidth: '0px'
						},
						component: {
							name: 'search-goods',
							props: {
								item: Object
							},
							attrs: {
								item
							},
							mounted() {
								this.$refs['real'].ruleForm.url = this.item.link;
								this.$refs['real'].ruleForm.couponUrl = this.item.couponUrl;
								this.$refs['real'].ruleForm.gid = this.item.gid;
								this.$refs['real'].submitForm('form');
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								},
								Goodsinfo(e) {
									self.crud.setForm('mdMoney', e.preCommssion);
									self.enterGoodsInfo = e;
								},
								perface(e) {
									self.perfaceValue_Rush = e;
								}
							},
							render() {
								return (
									<searchCounpon
										ref="real"
										onInput={this.input}
										onGoodsInfo={this.Goodsinfo}
										onperface={this.perface}
										item={self.enterGoodsInfo}></searchCounpon>
								);
							}
						},
						rules: [{ required: true, message: '请先检索商品', trigger: 'blur' }]
					},

					{
						prop: 'mdMoney',
						label: '补贴金额：',
						value: self.perfaceValue_Rush,
						component: {
							name: 'mdMoney_c',
							data() {
								return {
									value2: 0
								};
							},
							methods: {
								Change() {
									this.$emit('input', self.perfaceValue_Rush);
									if (
										self.perfaceValue_Rush >=
										(self.enterGoodsInfo.endPrice -
											self.enterGoodsInfo.hzQuanOver) *
											0.8
									) {
										self.$message.error('淘礼金金额不能大于商品券后价的80%');
									}
								}
							},
							props: {
								value: [String, Number]
							},
							watch: {
								value(val) {
									console.log(val);
									self.perfaceValue_Rush = val;
								},
								'self.enterGoodsInfo.preCommssion'(val) {
									console.log(val);
								}
							},

							render() {
								return (
									<div style="display:flex">
										<el-input-number
											max={
												Number(
													self.enterGoodsInfo.endPrice -
														self.enterGoodsInfo.hzQuanOver
												) * 0.8 || 0
											}
											step={0.01}
											min={0}
											v-model={self.perfaceValue_Rush}
											onfocus={this.Change}
											onChange={this.Change}></el-input-number>
										<div style="margin-left:10px">
											到手价格￥
											<span style="color:red">
												{(
													parseFloat(self.enterGoodsInfo.endPrice || 0) -
													(self.perfaceValue_Rush
														? self.perfaceValue_Rush
														: 0) -
													(self.enterGoodsInfo.hzQuanOver || 0)
												).toFixed(2)}
											</span>
											元
										</div>
										<div style="margin-left:10px">
											佣金￥
											<span style="color:red">
												{self.enterGoodsInfo.preCommssion || 0}
											</span>
											元
										</div>
									</div>
								);
							}
						},
						rules: [{ required: true, message: '补贴金额必须大于1', trigger: 'blur' }]
					},
					{
						prop: 'total',
						label: '活动商品个数：',
						span: 8,
						value: parseInt(Math.random() * (10000 - 5000 + 1) + 5000, 10),
						component: {
							name: 'el-input-number',
							attrs: {
								'controls-position': 'right',
								min: 1,
								max: 10000
							},
							on: {
								change(val) {
									self.defNumMax = val;
								}
							}
						},
						rules: [
							{
								required: true,
								message: '请输入活动商品数量',
								trigger: 'blur'
							}
						]
					},
					{
						prop: 'time',
						label: '活动时间：',
						span: 8,
						value: moment().format('YYYY-MM-DD'),
						component: {
							name: 'el-date-picker',
							attrs: {
								type: 'date',
								'value-format': 'yyyy-MM-dd'
							}
						},
						rules: [
							{
								required: true,
								message: '请选择活动时间',
								trigger: 'blur'
							}
						]
					},
					{
						prop: '_time',
						props: {
							'label-width': '0px'
						},
						span: 6,
						component: {
							name: 'el-select-s',
							data() {
								return {
									value2: localStorage.getItem('timevalue'),
									options: []
								};
							},
							created() {
								this.$service.goodsMenagement.goods.flashTime().then(res => {
									this.options = res.map(e => {
										return {
											label: e.time,
											value: e.time
										};
									});
									if (this.value2) {
										this.change(this.value2);
									}
								});
							},
							methods: {
								change(e) {
									localStorage.setItem('timevalue', e);
									Array.prototype.getArrayIndex = function(obj) {
										for (var i = 0; i < this.length; i++) {
											if (this[i].value === obj) {
												return i;
											}
										}
										return -1;
									};
									let end = '';
									if (this.options.getArrayIndex(e) + 1 == this.options.length) {
										end = '24:00';
									} else {
										end = this.options[this.options.getArrayIndex(e) + 1].value;
									}
									this.$emit('input', {
										start: e,
										end
									});
								}
							},
							render() {
								return (
									<el-select onChange={this.change} v-model={this.value2}>
										{this.options.map(item => {
											return (
												<el-option
													label={item.label}
													value={item.value}></el-option>
											);
										})}
									</el-select>
								);
							}
						},
						rules: [
							{
								required: true,
								message: '请选择活动时间',
								trigger: 'blur'
							}
						]
					},
					{
						prop: 'level',
						label: '商品排序：',
						value: 100,
						component: {
							name: 'levels',
							data() {
								return {
									level: 100
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.level = this.value;
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<div>
										<el-input-number
											v-model={this.level}
											controls-position="right"
											onInput={this.input}
											min={1}
											max={10000}></el-input-number>
										<span style="color:#999999;margin-left:10px">
											序号越大，排序越靠前
										</span>
									</div>
								);
							}
						}
					},
					{
						prop: 'defNum',
						label: '预设抢购：',
						value: 0,
						component: {
							name: 'defNum-s',
							data() {
								return {
									value2: 0
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.value2 = this.value;
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<div>
										<el-input-number
											v-model={this.value2}
											controls-position="right"
											onInput={this.input}
											min={0}
											max={self.defNumMax}></el-input-number>
									</div>
								);
							}
						}
					},
					{
						label: '状态',
						prop: 'status',
						value: 1,
						component: {
							name: 'el-select',
							options: [
								{
									label: '上架',
									value: 1
								},
								{
									label: '下架',
									value: 2
								}
							]
						}
					}
				],
				op: {
					visible: true,
					layout: ['confirm']
				},
				on: {
					load() {},
					submit({ data, close }) {
						data.app = data.app.join(',');
						data.quanMLink = self.enterGoodsInfo.quanMLink;
						data.hzQuanOver = self.enterGoodsInfo.hzQuanOver;
						self.$service.goodsMenagement.mdGoods
							.add({
								...data,
								...data.url,
								gid: item.gid,
								type: 1,
								startTime: data.time + ' ' + data._time.start,
								endTime: data.time + ' ' + data._time.end
							})
							.then(() => {
								self.$message({
									message: '设置成功',
									type: 'success'
								});
								self.crud.refresh();
								close();
								return;
							})
							.catch(err => {
								self.$message.error(err);
							});
					}
				}
			});
		},
		// 设置零元购
		setZero(item) {
			let self = this;
			this.$refs['cl-form'].open({
				props: {
					labelWidth: '120px',
					center: true,
					'custom-class': 'custom-class-dialog'
				},
				items: [
					{
						prop: 'pic',
						label: '商品主图：',
						span: 24,
						component: {
							name: 'cl-upload'
						}
					},
					{
						prop: 'title',
						label: '商品标题',
						span: 24,
						component: {
							name: 'el-input',
							attrs: {
								size: 'mini'
							}
						}
					},
					{
						prop: 'app',
						label: '平台',
						span: 13,
						value: [self.fromList[0].value],
						component: {
							name: 'el-select',
							options: self.fromList,
							attrs: {
								placeholder: '请选择平台',
								multiple: true
							},
							on: {
								change: id => {
									console.log(id);
								}
							}
						},
						rules: {
							required: true,
							message: '账号不能为空'
						}
					},
					{
						prop: 'gid',
						label: '商品ID',
						span: 10,
						value: item.gid,
						component: {
							name: 'el-input',
							attrs: {
								placeholder: '请选择'
							},
							props: {}
						}
					},
					{
						prop: 'url',
						props: {
							labelWidth: '0px'
						},
						component: {
							name: 'search-counpon',
							props: {
								item: Object
							},
							attrs: {
								item
							},
							mounted() {
								this.$refs['real'].ruleForm.url = this.item.link;
								this.$refs['real'].ruleForm.couponUrl = this.item.couponUrl;
								this.$refs['real'].ruleForm.gid = this.item.gid;
								this.$refs['real'].submitForm('form');
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								},
								Goodsinfo(e) {
									self.enterGoodsInfo = e;
								},
								perface(e) {
									self.perfaceValue_Zero = e;
								}
							},
							render() {
								return (
									<searchCounpon
										ref="real"
										onInput={this.input}
										onGoodsInfo={this.Goodsinfo}
										onperface={this.perface}
										item={self.enterGoodsInfo}></searchCounpon>
								);
							}
						},
						rules: [{ required: true, message: '请先检索商品', trigger: 'blur' }]
					},
					{
						prop: 'mdMoney',
						label: '补贴金额：',
						component: {
							name: 'mdMoney_c',
							data() {
								return {
									value2: 0
								};
							},
							methods: {
								Change() {
									this.$emit('input', self.perfaceValue_Zero);
									if (
										self.perfaceValue_Zero >=
										(self.enterGoodsInfo.endPrice -
											self.enterGoodsInfo.hzQuanOver) *
											0.8
									) {
										self.$message.error('淘礼金金额不能大于商品券后价的80%');
									}
								}
							},

							render() {
								return (
									<div style="display:flex">
										<el-input-number
											max={
												Number(
													self.enterGoodsInfo.endPrice -
														self.enterGoodsInfo.hzQuanOver
												) * 0.8 || 0
											}
											step={0.01}
											min={0}
											v-model={self.perfaceValue_Zero}
											onfocus={this.Change}
											onChange={this.Change}></el-input-number>
										<div style="margin-left:10px">
											到手价格￥
											<span style="color:red">
												{(
													parseFloat(self.enterGoodsInfo.endPrice || 0) -
													(self.perfaceValue_Zero
														? self.perfaceValue_Zero
														: 0) -
													(self.enterGoodsInfo.hzQuanOver || 0)
												).toFixed(2)}
											</span>
											元
										</div>
									</div>
								);
							}
						},
						rules: [{ required: true, message: '补贴金额必须大于1', trigger: 'blur' }]
					},
					{
						prop: 'total',
						label: '活动商品个数：',
						span: 8,
						value: parseInt(Math.random() * (10000 - 5000 + 1) + 5000, 10),
						component: {
							name: 'el-input-number',
							attrs: {
								'controls-position': 'right',
								min: 1,
								max: 10000
							}
						},
						rules: [
							{
								required: true,
								message: '请输入活动商品数量',
								trigger: 'blur'
							}
						]
					},
					{
						prop: 'time',
						label: '活动时间：',
						value: self.actime,
						span: 16,
						component: {
							name: 'el-date-picker',
							attrs: {
								type: 'datetimerange',
								'value-format': 'yyyy-MM-dd HH:mm:ss'
							}
						},
						rules: [
							{
								required: true,
								message: '请选择活动时间',
								trigger: 'blur'
							}
						]
					},
					{
						prop: 'level',
						label: '商品排序：',
						value: 100,
						component: {
							name: 'levels',
							data() {
								return {
									level: 100
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.level = this.value;
							},
							methods: {
								input(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<div>
										<el-input-number
											v-model={this.level}
											controls-position="right"
											onInput={this.input}
											min={1}
											max={10000}></el-input-number>
										<span style="color:#999999;margin-left:10px">
											序号越大，排序越靠前
										</span>
									</div>
								);
							}
						}
					},
					{
						prop: 'status',
						label: '商品状态：',
						value: 1,
						component: {
							name: 'g_radio',
							data() {
								return {
									value2: 1
								};
							},
							props: {
								value: [String, Number]
							},
							mounted() {
								this.value2 = Number(this.value || 1);
							},
							methods: {
								change(e) {
									this.$emit('input', e);
								}
							},
							render() {
								return (
									<el-radio-group onChange={this.change} v-model={this.value2}>
										<el-radio label={1}>上架</el-radio>
										<el-radio label={2}>下架</el-radio>
									</el-radio-group>
								);
							}
						}
					}
				],
				op: {
					visible: true,
					layout: ['confirm']
				},
				on: {
					submit({ data, close }) {
						data.app = data.app.join(',');
						data.quanMLink = self.enterGoodsInfo.quanMLink;
						data.hzQuanOver = self.enterGoodsInfo.hzQuanOver;
						self.$service.goodsMenagement.mdGoods
							.add({
								...data,
								...data.url,
								gid: item.gid,
								startTime: data.time[0],
								endTime: data.time[1],
								isFree: 1,
								type: 0
							})
							.then(() => {
								self.$message({
									message: '设置成功',
									type: 'success'
								});
								self.crud.refresh();
								close();
								return;
							})
							.catch(err => {
								self.$message.error(err);
							});
					}
				}
			});
		},
		onLoad({ ctx, app }) {
			const self = this;
			this.crud = app;
			ctx.service(this.$service.jd.jdActivityGoods)
				.set('dict', {
					api: {
						info: 'detail'
					}
				})
				.set('table', {
					columns: [
						{
							label: '序号',
							type: 'index',
							align: 'center',
							width: 80
						},
						{
							label: '商品信息',
							prop: 'goodInfo',
							align: 'left',
							'min-width': 400
						},
						{
							label: '优惠券信息',
							prop: 'couponInfo',
							align: 'left',
							'min-width': 350
						},
						{
							label: '活动类型',
							prop: 'type',
							align: 'center',
							emptyText: '百亿补贴',
							'min-width': 150
						},
						{
							label: '出单量',
							prop: 'orderNum',
							align: 'center',
							sortable: 'custom',
							emptyText: '0',
							'min-width': 100
						},
						{
							label: '商品排序',
							prop: 'level',
							align: 'center',
							sortable: 'custom',
							emptyText: '0',
							'min-width': 100
						},
						{
							label: '佣金比例',
							prop: 'commissionRate',
							align: 'center',
							emptyText: '0',
							'min-width': 100
						},
						{
							label: '数据统计',
							prop: 'count',
							align: 'center',
							'min-width': 150
						},
						{
							label: '活动时间',
							prop: 'date',
							align: 'center',
							'min-width': 250
						},
						{
							label: '是否下架',
							prop: 'status',
							align: 'center',
							'min-width': 100
						},
						{
							label: '平台',
							prop: 'app',
							align: 'center',
							'min-width': 100
						}
					],

					op: {
						props: {
							width: 140
						},
						layout: [
							'slot-setFree',
							'slot-setSort',
							'slot-setBillion',
							'slot-setTime',
							'slot-zero'
						]
					}
				})
				.set('upsert', {
					props: {
						labelWidth: '120px',
						center: true,
						'custom-class': 'custom-class-dialog'
					},
					items: [
						{
							prop: 'skuImage',
							label: '商品主图：',
							span: 24,
							component: {
								name: 'cl-upload'
							}
						},
						{
							prop: 'skuName',
							label: '商品标题',
							span: 24,
							component: {
								name: 'el-input',
								attrs: {
									size: 'mini',
									placeholder: '请输入商品标题'
								}
							}
						},
						{
							prop: 'url',
							props: {
								labelWidth: '0px'
							},
							// label: '优惠券链接：',
							component: {
								name: 'search-counpon',
								methods: {
									input(e) {
										this.$emit('input', e);
									},
									onCoupon(e) {
										self.selects.coupon = e;
									},
									onJmoney(e) {
										app.setForm('jljMoney', e);
									},
									Goodsinfo(e) {
										app.setForm('defNum', e.sale);
									}
								},
								render() {
									return (
										<searchCounpon
											onGoodsInfo={this.Goodsinfo}
											onInput={this.input}
											onCoupon={this.onCoupon}
											on-jmoney={this.onJmoney}
											item={self.enterGoodsInfo}></searchCounpon>
									);
								}
							},
							rules: [{ required: true, message: '请先检索商品', trigger: 'blur' }]
						},

						{
							prop: 'type',
							label: '活动类型',
							component: {
								name: 'el-select',
								props: {
									placeholder: '请选择活动类型',
									clearable: true
								},
								options: [
									{
										label: '零元购',
										value: '0'
									},
									{
										label: '限时抢购',
										value: '1'
									},
									{
										label: '新人专享',
										value: '2'
									},
									{
										label: '百亿补贴',
										value: '3'
									},
									{
										label: '大转盘',
										value: '4'
									}
								]
							},
							rules: [
								{
									required: true,
									message: '请选择活动类型',
									trigger: 'blur'
								}
							]
						},
						{
							prop: 'floorId',
							label: '商品分类',
							value: '',
							component: {
								name: 'el-select',
								props: {
									placeholder: '请选择商品分类',
									clearable: true
								}
							},
							rules: [
								{
									required: true,
									message: '请选择商品分类',
									trigger: 'blur'
								}
							]
						},
						{
							label: '商品基数',
							prop: 'defNum',
							value: 0,
							component: {
								name: 'el-input-number',
								props: {}
							},
							rules: {
								required: true,
								message: '商品基数不能为空'
							}
						},
						{
							label: '京礼金总数',
							prop: 'total',
							value: 1,
							component: {
								name: 'el-input-number',
								props: {
									min: 0
								},
								on: {
									change(val) {
										let num = app.getForm('jljMoney');
										app.setForm('jljTotal', val * num);
									}
								}
							},
							rules: {
								required: true,
								message: '京礼金总数不能为空'
							}
						},
						{
							label: '京礼金金额',
							prop: 'jljMoney',
							value: 1,
							component: {
								name: 'el-input-number',
								props: {
									min: 0
								},
								on: {
									change(val) {
										let num = app.getForm('total');
										if (val == 0) {
											app.hiddenItem('jljTotal', true);
										} else {
											app.hiddenItem('jljTotal', false);
											app.setForm('jljTotal', val * num);
										}
									}
								}
							},
							rules: {
								required: true,
								message: '京礼金金额不能为空'
							}
						},
						{
							label: '京礼金总金额',
							prop: 'jljTotal',
							value: 1,
							hidden:false,
							component: {
								name: 'el-input',
								props: {
									disabled: true
								}
							},
							rules: {
								required: true,
								trigger: ['blur', 'change'],
								validator: (rule, value, callback) => {
									if (value >= 50) {
										callback();
									} else {
										callback(new Error('京礼金总金额需大于50'));
									}
								}
							}
						},
						{
							label: '活动时间',
							prop: '_date',
							value: [
								moment()
									.add(1, 'days')
									.format('YYYY-MM-DD 00:00:00'),
								moment()
									.add(1, 'days')
									.format('YYYY-MM-DD 23:59:59')
							],
							component: {
								name: 'el-date-picker',
								props: {
									'value-format': 'yyyy-MM-dd HH:mm:ss',
									type: 'datetimerange'
								}
							},
							rules: {
								required: true,
								message: '活动时间不能为空'
							}
						},
						{
							prop: 'level',
							label: '商品排序：',
							value: 100,
							component: {
								name: 'levels',
								data() {
									return {
										level: 100
									};
								},
								props: {
									value: [String, Number]
								},
								mounted() {
									this.level = this.value;
								},
								methods: {
									input(e) {
										this.$emit('input', e);
									}
								},
								render() {
									return (
										<div style="display:flex">
											<el-input-number
												v-model={this.level}
												controls-position="right"
												onInput={this.input}
												min={1}
												max={10000}></el-input-number>
											<span style="color:#999999;margin-left:10px">
												序号越大，排序越靠前
											</span>
										</div>
									);
								}
							}
						},
						{
							label: '使用有效日期',
							prop: 'effectiveDays',
							span: 12,
							value: 0,
							component: {
								name: 'el-input-number',
								props: {
									min: 1,
									max: 7
								}
							},
							rules: {
								required: true,
								message: '使用有效日期不能为空'
							}
						},
						{
							prop: 'status',
							label: '商品状态：',
							value: 1,
							component: {
								name: 'g_radio',
								data() {
									return {
										value2: 1
									};
								},
								props: {
									value: [String, Number]
								},
								mounted() {
									this.value2 = Number(this.value || 1);
								},
								methods: {
									change(e) {
										this.$emit('input', e);
									}
								},
								render() {
									return (
										<el-radio-group
											onChange={this.change}
											v-model={this.value2}>
											<el-radio label={1}>上架</el-radio>
											<el-radio label={0}>下架</el-radio>
										</el-radio-group>
									);
								}
							}
						},
						{
							label: '是否绑定spu',
							prop: 'isSpu',
							value: 0,
							component: {
								name: 'el-radio-group',
								options: [
									{
										label: '是',
										value: 1
									},
									{
										label: '否',
										value: 0
									}
								]
							}
						}
					],
					op: {
						visible: true,
						layout: ['confirm']
					}
				})
				.set('layout', [
					['refresh-btn', 'slot-add', 'query', 'flex1', 'search-key'],
					['slot-filter'],
					['data-table'],
					['flex1', 'pagination']
				])
				.on('open', isEdit => {
					if (!isEdit) {
						// app.setForm('defNum', parseInt(Math.random() * 1000) + 1000);
					}
					app.hiddenItem('jljTotal', false);
					this.crud.setData(
						'upsert.items[prop:floorId].component.options',
						this.options.specialClassify
					);
				})
				.on('close', isOpen => {
					if (!isOpen) {
						// 清空商品数据
						this.enterGoodsInfo = {};
					}
				})
				.on('submit', (isOpen, data, { next }) => {
					delete data.jljTotal;
					const [startTime, endTime] = data._date || [];

					next({
						...data,
						url: data.url.url,
						couponInfo: this.selects.coupon,
						startTime,
						endTime
					});
				})
				.on('refresh', async (params, { next, render }) => {
					if (params.isNine === '') {
						delete params.isNine;
					}
					if (params.isDhh === '') {
						delete params.isDhh;
					}
					let { list } = await next(params);
					list.map(item => {
						item.commissionRate = (item.commissionRate || 0) + '%';
						item.sale = item.sale + '件';
					});
					render(list);

					// 获取类目
					let list2 = await this.$service.jd.specialClassify.list({
						specialType: 104
					});
					this.options.specialClassify = list2.map(item => {
						return {
							label: item.accountName,
							value: item.accountId
						};
					});
				})
				.done();

			app.refresh({
				status: 1,
				startSale: 0,
				startTime: moment().format('YYYY-MM-DD 00:00:00'),
				endTime: moment().format('YYYY-MM-DD 23:59:59'),
				order: 'desc',
				prop: 'level'
			});
		},
		// 录入商品
		addGoods() {
			this.crud.add();
		},
		// 选择时间
		onDateChange(val) {
			const [startTime, endTime] = val || [];
			this.refresh({
				startTime,
				endTime
			});
		},
		refresh(data) {
			this.crud.refresh({
				...data
			});
		},
		// 配置自动上品
		putWayGoods() {
			this.$service.goodsMenagement.bwbtConfig.jdYzf().then(res => {
				this.putWayForm = res.config
				console.log(this.putWayForm);
				this.putWayVisible = true;
			})			
		},
		openForm_CRUD() {
			this.$refs['cl-form'].open({
				props: {
					title: '查看分类',
					width: '800px',
					size: 'mini'
				},
				op: {
					confirmButtonText: '保存',
					cancelButtonText: '关闭',

					layout: ['cancel'] // 同crud下的layout
				},
				items: [
					{
						prop: '104',
						value: 104,
						component: openCurd
					}
				]
			});
		},
		savePutWay() {
			this.$service.goodsMenagement.bwbtConfig.updateJdYzf(this.putWayForm).then(res => {
				this.$message.success('保存成功！')
				this.putWayVisible = false
			})
		}
	}
};
</script>

<style lang="scss" scoped>
.nav {
	padding: 10px 0;
	font-size: $font12;
	::v-deep .el-input-number.is-controls-right .el-input__inner {
		padding-left: 15px;
		padding-right: 20px;
	}
	::v-deep .el-input-number--mini {
		width: 71px;
	}
	.nav-li {
		margin-right: 8px;
		span {
			color: $text-grey;
			margin-right: 10px;
		}
		.el-select {
			width: 90px;
		}
		.el-input-number--mini {
			width: 100px;
		}
	}
}
.setsort {
	color: $color-link;
	cursor: pointer;
	margin: 5px 5px 5px 15px;
	:hover {
		opacity: 0.8;
	}
}
.column-count {
	span {
		color: red;
	}
}
</style>
